Skip to content

Conversation

compiler-errors
Copy link
Member

Record whether a hir::GenericParam comes from an item's generics, or from a for<...> binder. Then, only look for the param in object_lifetime_default if it actually comes from the item's generics.

Fixes #108177

@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 28, 2023
@@ -1375,8 +1379,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
span,
);
let ident = Ident::from_str_and_span(&pprust::ty_to_string(t), span);
let (param, bounds, path) =
self.lower_generic_and_bounds(*def_node_id, span, ident, bounds);
let (param, bounds, path) = self.lower_universal_param_and_bounds(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by nitpick rename of this fn, because we only use it for AFIT. Can revert if desired.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 28, 2023

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Feb 28, 2023

📌 Commit f851a8a has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 28, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Feb 28, 2023
…default, r=oli-obk

Only look for param in item's generics if it actually comes from generics

Record whether a `hir::GenericParam` comes from an item's generics, or from a `for<...>` binder. Then, only look for the param in `object_lifetime_default` if it actually comes from the item's generics.

Fixes rust-lang#108177
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 28, 2023
…default, r=oli-obk

Only look for param in item's generics if it actually comes from generics

Record whether a `hir::GenericParam` comes from an item's generics, or from a `for<...>` binder. Then, only look for the param in `object_lifetime_default` if it actually comes from the item's generics.

Fixes rust-lang#108177
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#108297 (Exit when there are unmatched delims to avoid noisy diagnostics)
 - rust-lang#108531 (rustdoc: Show that repeated expression arrays can be made with constant values)
 - rust-lang#108536 (Update books)
 - rust-lang#108550 (Remove the `capture_disjoint_fields` feature)
 - rust-lang#108551 (Descriptive error when users try to combine RPITIT/AFIT with specialization)
 - rust-lang#108554 (Only look for param in item's generics if it actually comes from generics)
 - rust-lang#108555 (Fix a race in the query system)
 - rust-lang#108558 (add missing feature in core/tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 19604c2 into rust-lang:master Mar 1, 2023
@rustbot rustbot added this to the 1.69.0 milestone Mar 1, 2023
@compiler-errors compiler-errors deleted the late-bound-object-default branch August 11, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: non_lifetime_binders: resolve_bound_vars.rs: called Option::unwrap() on a None value
4 participants